package ${cfg.basePackage}.module.${cfg.moduleName}.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ${cfg.basePackage}.common.model.SRS;
import ${cfg.basePackage}.module.${cfg.moduleName}.service.${entity}Service;
import puffer.starter.web.resource.ResC;
import puffer.starter.web.resource.ResM;

import java.util.Map;

@ResC("${table.comment!}")
@RestController
@RequestMapping("/${table.entityPath}/${table.entityPath}")
public class ${entity}Controller {
    @Autowired
    private ${entity}Service service;

    @ResM("新增")
    @RequestMapping({"/add"})
    public SRS add(${r"@RequestBody Map<String, Object> param"}) {
        return service.add(param);
    }

    @ResM("删除")
    @RequestMapping({"/del"})
    public SRS del(${r"@RequestBody Map<String, Object> param"}) {
        return service.del(param);
    }

    @ResM("修改")
    @RequestMapping({"/edit"})
    public SRS edit(${r"@RequestBody Map<String, Object> param"}) {
        return service.edit(param);
    }

    @ResM("查询详情")
    @RequestMapping("/info")
    public SRS info(${r"@RequestBody Map<String, Object> param"}) {
        return service.info(param);
    }

    @ResM("查询集合")
    @RequestMapping({"/list"})
    public SRS list(${r"@RequestBody Map<String, Object> param"}) {
        return service.list(param);
    }

    @ResM("分页查询")
    @RequestMapping("/page")
    public SRS page(${r"@RequestBody Map<String, Object> param"}) {
        return service.page(param);
    }
}
